
		**********************************************************
		** File: cleaning_UNODC_2006.do							**
		** Paper: Human Trafficking Indicators: A New Dataset	**
		** Author: Richard Frank								**
		** Date: July 11, 2021									**
		** Task: Cleaning UNODC (2006) trafficking data			**
 		**********************************************************
		
 

	clear
	version 16
	set seed 1234

	import excel "UNODC s t d 2006.xlsx", sheet("Sheet1") firstrow case(lower) clear
	
	rename country Country
	run "cow.do"

	sort ccode
	drop if ccode==0
 
	replace source="0" if source==""
	replace source="1" if source=="VL"	
	replace source="2" if source=="L"
	replace source="3" if source=="M"	
	replace source="4" if source=="H"	
	replace source="5" if source=="VH"	
 	destring source, replace
	label var source "UNODC 2006 source (0-5)"
	
	replace transit="0" if transit==""
	replace transit="1" if transit=="VL"	
	replace transit="2" if transit=="L"
	replace transit="3" if transit=="M"	
	replace transit="4" if transit=="H"	
	replace transit="5" if transit=="VH"	
 	destring transit, replace
	label var transit "UNODC 2006 transit (0-5)"
	
	replace destination="0" if destination==""
	replace destination="1" if destination=="VL"	
	replace destination="2" if destination=="L"
	replace destination="3" if destination=="M"	
	replace destination="4" if destination=="H"	
	replace destination="5" if destination=="VH"	
 	destring destination, replace
	label var destination "UNODC 2006 destination (0-5)"
	
	gen year =2006
	order ccode Country year
	
	rename source source_UNODC
	rename transit transit_UNODC
	rename dest dest_UNODC
	
	save "UNODC_2006_std.dta", replace
